// 结构体对齐规则
#include <stdio.h>
#include <stdlib.h>

struct student
{
    int a;
    char b;
    int c;
};


struct stu
{
    int a;
    char b;
    char c;
};

struct stu1
{
    char a;
    int b;
    char c;
};

int main(int argc, char **argv)
{
    struct student s1;

    // 输出所占大小
    printf("%lu\n", sizeof(s1));

    // 输出地址
    printf("%p\n", &s1.a);
    printf("%p\n", &s1.b);
    printf("%p\n", &s1.c);

    struct stu s2;

    // 输出所占大小
    printf("%lu\n", sizeof(s2));

    // 输出地址
    printf("%p\n", &s2.a);
    printf("%p\n", &s2.b);
    printf("%p\n", &s2.c);

    struct stu1 s3;

    // 输出所占大小
    printf("%lu\n", sizeof(s3));

    // 输出地址
    printf("%p\n", &s3.a);
    printf("%p\n", &s3.b);
    printf("%p\n", &s3.c);

    return 0;
}